Skip to content

doc: added documentation for input type=file #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

doc: added documentation for input type=file #218

wants to merge 1 commit into from

Conversation

el1f
Copy link

@el1f el1f commented Oct 28, 2017

Added some explaination on how to implement this form type in React as suggested in #86

@facebook-github-bot
Copy link
Collaborator

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@reactjs-bot
Copy link

Deploy preview ready!

Built with commit 1ae3d1d

https://deploy-preview-218--reactjs.netlify.com

@facebook-github-bot
Copy link
Collaborator

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

e.preventDefault();

this.setState({
file: e.target.files[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think the file needs to be saved in state, unless I'm overlooking something. Probably having a ref to the file input and use it to access the file(s) in submit handler (or wherever required) would be a better option IMHO. See if this makes sense - https://codepen.io/tsriram/pen/qVNoZL?editors=0011

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, using the file by ref is definitly a betetr solution. My bad. Will change it ASAP

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Friendly ping 😄

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry guys, been away for a while and didn't notice the progress of the issue. Seems like @vishalvrv9 has worked on a fix of my PR based on @tsriram's suggestion. Should I go ahead and fix mine or would it better to merge his?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't reviewed his PR yet, so I don't know for sure. But since he created his when this one seemed to have been dropped, maybe we should try his?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, had some issues so I couldn't track down my PR after submitting it but the man definitly deserves some attention for his efforts ;)

@el1f el1f closed this Feb 6, 2018
jhonmike pushed a commit to jhonmike/reactjs.org that referenced this pull request Jul 1, 2020
BetterZxx pushed a commit to BetterZxx/react.dev that referenced this pull request Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants